package com.example.demo.enums;

public enum FileUseEnum {

    VIEW("V", "查看"),
    JUDGE("G", "评测"),
    READ_FILE("RF", "读取文件中的内容后评测"),
    EVALUATE_FUNCTION_FIGURE("EFF", "评测函数图形"),
    EVALUATE_GEOMETRIC_FIGURE("EGF", "评测几何图形"),
    EVALUATE_STATISTICAL_CHART("ESC", "评测统计图形"),
    NOTICE("NOTICE", "公告轮播图");

    private String code;

    private String desc;

    FileUseEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public static FileUseEnum getByCode(String code){
        for(FileUseEnum e: FileUseEnum.values()){
            if(code.equals(e.getCode())){
                return e;
            }
        }
        return  null;
    }
}
